<template>
  <div id="aside">
    <div class="logo"
         :style="{width : $store.state.isCollapse?'auto':'200px'}">
      <img src="@/assets/logo.png"
           class="pic" />
      <h3 class="title"
          v-show="!$store.state.isCollapse"> VUE3_SHOP</h3>
    </div>
    <el-menu default-active="/main/index"
             background-color="#545c64"
             text-color="#fff"
             active-text-color="#ffd04b"
             router
             :collapse="$store.state.isCollapse">
      <el-menu-item index="/main/index">
        <el-icon :size="30">
          <house />
        </el-icon>
        <span>首页</span>
      </el-menu-item>
      <el-sub-menu index="1">
        <template #title>
          <el-icon :size="30">
            <platform />
          </el-icon>
          <span>商品管理</span>
        </template>
        <el-menu-item index="/main/goods-manage">新建商品</el-menu-item>
        <el-menu-item index="/test/new">工作</el-menu-item>
      </el-sub-menu>
      <el-sub-menu index="2">
        <template #title>
          <el-icon :size="30">
            <operation />
          </el-icon>
          <span>系统管理</span>
        </template>
        <el-menu-item index="/main/user-management">用户管理</el-menu-item>
        <el-menu-item index="/main/os-detail">服务器信息</el-menu-item>
      </el-sub-menu>
    </el-menu>
  </div>
</template>




<script>
import { defineComponent, reactive, ref } from 'vue'
import { House, Operation, Platform } from '@element-plus/icons-vue'
import { useStore } from "vuex";
export default defineComponent({
  name: 'aside',
  components: { House, Operation, Platform },
  setup() { }
})

</script>

<style lang="less" scoped>
#aside {
  .el-menu {
    border: none;
  }
  .logo {
    height: 59px;
    display: flex;
    align-items: center;
    justify-content: center;
    .pic {
      width: 30px;
      height: 30px;
    }
    .title {
      color: #fff;
      padding-left: 5px;
    }
  }
}
</style>